home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / PROGRAM / UCRASM25.ARJ / NEXTITEM.ASM < prev    next >
Assembly Source File  |  1991-10-12  |  634b  |  43 lines

  1. StdGrp        group    stdlib,stddata
  2. stddata        segment    para public 'sldata'
  3. stddata        ends
  4. ;
  5. stdlib        segment    para public 'slcode'
  6.         assume    cs:stdgrp
  7. ;
  8. ;
  9. ; NextItem-    Locates the first (next) character in the set.
  10. ;
  11. ; inputs:
  12. ;
  13. ;    ES:DI-  Points at the set to search through.
  14. ;
  15. ; outputs:
  16. ;
  17. ;    AL-    Next available character in set (zero if set is empty).
  18. ;
  19. ;
  20.         public    sl_NextItem
  21. ;
  22. sl_NextItem    proc    far
  23.         push    cx
  24.         push    di
  25. ;
  26.         mov    al, es:[di]
  27.         mov    cx, 256
  28.         add    di, 7
  29. NextLp:        inc    di
  30.         test    al, es:[di]
  31.         loopz    NextLp
  32. ;
  33.         neg    cx
  34.         mov    al, cl
  35.         pop    si
  36.         pop    cx
  37.         ret
  38. sl_NextItem    endp
  39. ;
  40. ;
  41. stdlib        ends
  42.         end
  43.